<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script type="module">
      // 启用ES6模块化语法：type="module"
      // async function fn() {
      //   await new Promise(() => {})
      // }

      const result1 = await new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve("数据a");
        }, 1000);
      });
      const result2 = await new Promise((resolve) => {
        setTimeout(() => {
          resolve("数据b");
        }, 1000);
      });
      const result3 = await new Promise((resolve) => {
        setTimeout(() => {
          resolve("数据c");
        }, 1000);
      });

      console.log(result1, result2, result3);
    </script>
  </body>
</html>
